<template>
    <div class="my-range">
        <div class="input-daterange input-group">
            <input :type="type" class="form-control" name="start" v-model="start" />
            <span class="input-group-addon bg-info b-0 text-white">to</span>
            <input :type="type" class="form-control" name="end" v-model="end"/>
        </div>
    </div>

</template>

<script>
    export default {
        name: "Range",
        props: {
            type: {
                type: String,
                default: 'text'
            },
            value: {
                type: String,
                default: ''
            }
        },
        data() {
            return {
                start: '',
                end: ''
            }
        },
        methods: {
            process() {
                return this.start + '/' + this.end
            }
        },
        watch: {
            start() {
                this.$emit('input', this.process())
            },
            end() {
                this.$emit('input', this.process())
            }
        }
    }
</script>

<style scoped>

</style>